<template>
  <div class="base-setting">
    <pageHeader
      :title="title"
      :breadCrumb="breadCrumb"
      :isShowBtn="false"
    ></pageHeader>
    <div class="base-setting-warp">
      <div v-for="(item, index) in setting" :key="index">
        <settingWrap
          @goDetail="goDetail(item)"
          :name="item.name"
          :description="item.description"
          :icon="item.icon"
        ></settingWrap>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
  import { reactive, ref } from 'vue';
  import pageHeader from '@/components/page-header/index.vue';
  import settingWrap from '@/components/setting-wrap/index.vue';
  import { useRouter } from 'vue-router';

  const router = useRouter();
  const title: string = '基础设置';

  const breadCrumb: string[] = ['设备管理', '基础设置'];

  const setting = reactive([
    {
      name: '设备类型',
      description: '-主要用于配置机械设备类型',
      icon: 'icon-settings',
      path: 'TypeEquipment',
    },
    {
      name: '设备编码(内部)',
      description: '-主要于配置设备内部统一编号，方便查询',
      icon: 'icon-settings',
      path: 'NumberEquipment',
    },
    {
      name: '维修单号设置',
      description: '-主要用于配置设备维修单号',
      icon: 'icon-settings',
      path: 'MaintenanceOrderNo',
    },
    {
      name: '保养单号设置',
      description: '-主要用于配置设备保养单号',
      icon: 'icon-settings',
      path: 'UnkeepOrderNo',
    },
    // {
    //   name: '设备折旧年限设置',
    //   description: '-主要用于配置各个设备的折旧年限',
    //   icon: 'icon-settings',
    //   path: 'OldyearEquipment',
    // },
    {
      name: '设备完好状态',
      description: '-主要用于配置设备的完好状态',
      icon: 'icon-settings',
      path: 'GoodStateEquipment',
    },
    {
      name: '设备使用状态',
      description: '-主要用于配置设备使用过程中的不同状态',
      icon: 'icon-settings',
      path: 'UseStateEquipment',
    },
    {
      name: '设备故障类别设置',
      description: '-主要用于配置设备故障的各种类别',
      icon: 'icon-settings',
      path: 'FaultTypeEquipment',
    },
    {
      name: '设备负荷等级设置',
      description: '-主要用于配置各个设备的负荷等级',
      icon: 'icon-settings',
      path: 'DeviceLoadLevel',
    },
    // {
    //   name: '设备类型编号',
    //   description: '-主要用于配置设备类型编码',
    //   icon: 'icon-settings',
    //   path: 'TypeNumberEquipment',
    // },
  ]);

  const goDetail = (item: any) => {
    router.push({
      name: item.path,
    });
  };
</script>

<style scoped lang="less">
  .base-setting {
    &-warp {
      display: flex;
      flex: 1;
      flex-wrap: wrap;
    }
  }
</style>
